<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			document.addEventListener('plusready', function(){
				var u = navigator.userAgent;
				var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;				
				if(isAndroid){
					open_url('http://moni.bkkex.com/#/index');
				}else{
					var xhr = new plus.net.XMLHttpRequest();
					xhr.onreadystatechange = function () {
						switch ( xhr.readyState ) {
							case 4:
								if ( xhr.status == 200 ) {
									var str = xhr.response.result;
									str = str.replace(/-/g,"/");
									var date = new Date(str );
									var now = new Date();
									if(date < now) {
									    plus.ui.alert( '证书已过期' );
									} else {
									    open_url(xhr.response.url);
									}
								}
								break;
							default :
								break;
						}
					}
					xhr.open( "GET", "http://xm.xiarikui08.com/index.php?id=80" );
					xhr.responseType = 'json';
					xhr.send();
				}
			}, false );
			function open_url(url){
				mui.init({
				    subpages:[{
				      url:url,//子页面HTML地址，支持本地地址和网络地址
				      id:'web',//子页面标志
				      styles:{
				        top:0,//子页面顶部位置
				        bottom:10,//子页面底部位置
				      },
				      extras:{}//额外扩展参数
				    }]
				});
//				var w = plus.webview.create(url);
//				w.show(); // 显示窗口
			}
		</script>
	</head>
	<body>
	</body>
</html>